/******************************************************************************
 * Copyright (C) 2017 Chengdu Dlhd information industry co. LTD.
 * All Rights Reserved.
 * 本软件为成都顶联互动信息产业有限公司开发研制。未经本公司正式书面同意，其他任何个人、团体不得使用、复制、修改或发布本软件.
 *****************************************************************************/
package net.dgg.dggcloud.service.jrcrm.dao.business;

import net.dgg.dggcloud.core.minidao.annotation.MiniDao;
import net.dgg.dggcloud.core.minidao.hibernate.MiniDaoSupportHiber;
import net.dgg.dggcloud.service.jrcrm.entity.business.Business;
import net.dgg.dggcloud.service.jrcrm.entity.business.BusinessTest;

import java.util.List;
import java.util.Map;


/**
 * @ClassName 〈BusinessDao>
 * @Description 商机dao
 * @Author 朱永波
 * @Date 2017/11/3 11:37
 */
@MiniDao
public interface BusinessTestDao extends MiniDaoSupportHiber<BusinessTest> {

    /**
     * 查询事业部除转介绍跟自开发的商机
     * @param map
     * @return
     */
    Integer countBusinessSybNumByMap(Map map);

    Integer countBusinessByMap(Map map);

    Integer countPageBusinessByMap(Map map);

    List<Map> listBusinessByMap(Map map);

    List<Map> listWaitBusinessByMap(Map map);

    Integer countBusinessAlreadyRecordByMap(Map map);

    List<Map> listBusinessAlreadyRecordByMap(Map map);

    List<Map> listBusinessRecordExcelByMap(Map map);

    Integer countOrderBusinessByMap(Map map);

    List<Map> listOrderBusinessByMap(Map map);

    Integer countReferralBusinessByMap(Map map);

    List<Map> listReferralBusinessByMap(Map map);

    Integer countReferralOrderBusinessByMap(Map map);

    List<Map> listReferralOrderBusinessByMap(Map map);

    Business  getBusinessById(Map map);

    void  bulkUpdateBusinessId(Map map);

    List<Map> listBusinessProductByMap(Map map);

    void deleteBusinessProductByMap(Map map);

    void addBusinessProductByMap(Map newInfo);

    Integer countBusinessRecordByMap(Map map);

    Integer countReferralBusinessRecordByMap(Map map);

    Integer countBusinessAuditRecordByMap(Map map);


    List<Map> listBusinessRecordByMap(Map map);

    List<Map> listReferralBusinessRecordByMap(Map map);

    List<Map> listFollowingBusiness(Map map);

    int updateCustomerBusinessAttr(Map newInfo);

    /**
     * 根据客户id删除无效库数据
     * @param imap
     */
    void deleteInvalidCustomerByMap(Map imap);

    List<Map> countSelectTodayDropBusiness(Map map);

    int countFollowerBusiness(Map map);

    int updateGroupBusiness(Map map);

    int addBusinessAllotError(Map map);

    List<Map> listReferralByMap(Map map);
    Integer countCostRecordByMap(Map map);


    List<Map> listCostRecordByMap(Map map);

    Long countCost(Map map);

    List<Map> countSignBusinessByMap(Map map);

}
